package com.seari.tunnel.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seari.tunnel.entity.AlarmHistory;
import com.seari.tunnel.entity.OperationHistory;
import com.seari.tunnel.entity.OperationRepair;
import com.seari.tunnel.entity.OperationSpare;
import com.seari.tunnel.entity.RecordHistory;
import com.seari.tunnel.mapper.AlarmHistoryMapper;
import com.seari.tunnel.mapper.OperationHistoryMapper;
import com.seari.tunnel.mapper.OperationRepairMapper;
import com.seari.tunnel.mapper.OperationSpareMapper;
import com.seari.tunnel.mapper.RecordHistoryMapper;
import com.seari.tunnel.service.IOperatMaintenanceService;

@Service(IOperatMaintenanceService.SERVICE_NAME)
public class OperatMaintenanceServiceImpl implements IOperatMaintenanceService{
	@Autowired
	OperationRepairMapper operationRepairMapper;
	@Autowired
	OperationSpareMapper operationSpareMapper;
	@Autowired
	AlarmHistoryMapper alarmHistoryMapper;
	@Autowired
	OperationHistoryMapper operationHistoryMapper;
	@Autowired
	RecordHistoryMapper recordHistoryMapper;
	
	@Override
	public List<OperationRepair> findOperationRepairs() {
		
		return operationRepairMapper.findOperationRepairs();
	}

	@Override
	public void deleteById(int id) {
		operationRepairMapper.deleteById(id);
		
	}

	@Override
	public void addOperationRepair(OperationRepair operationRepair) {
		operationRepairMapper.addOperationRepair(operationRepair);
		
	}

	@Override
	public void updateOperationRepairFile(int id, String fileName) {
		operationRepairMapper.updateOperationRepairFile(id, fileName);
		
	}

	@Override
	public void updateOperationRepair(OperationRepair operationRepair) {
		operationRepairMapper.updateOperationRepair(operationRepair);
		
	}

	@Override
	public List<OperationSpare> findOperationSpare() {
		
		return operationSpareMapper.findOperationSpare();
	}

	@Override
	public void deleteOperationSapreById(int id) {
		operationSpareMapper.deleteOperationSapreById(id);
		
	}

	@Override
	public void addOperationSpare(OperationSpare operationSpare) {
		operationSpareMapper.addOperationSpare(operationSpare);
		
	}

	@Override
	public void updateOperationSpare(OperationSpare operationSpare) {
		operationSpareMapper.updateOperationSpare(operationSpare);
		
	}

	@Override
	public void addAlarmHistory(AlarmHistory alarmHistory) {
		
		alarmHistoryMapper.addAlarmHistory(alarmHistory);
	}

	@Override
	public List<AlarmHistory> findAlarmHistory() {
		
		return alarmHistoryMapper.findAlarmHistory();
	}
	
	@Override
	public void addOperationHistory(OperationHistory operationHistory) {
		operationHistoryMapper.addOperationHistory(operationHistory);
		
	}

	@Override
	public List<OperationHistory> findOperationHistory(OperationHistory oh) {
		return operationHistoryMapper.findOperationHistory(oh);
	}

	@Override
	public void addRecordHistory(RecordHistory rh) {
		recordHistoryMapper.addRecordHistory(rh);
		
	}

	@Override
	public List<RecordHistory> findDataHistory(RecordHistory rh) {
		// TODO Auto-generated method stub
		return recordHistoryMapper.findDataHistory(rh);
	}
	
}
